#include<Gl\glut.h>
#include"Floor.h"

/*************************************************************************************/

void Floor::renderFloor(){
	glEnable(GL_TEXTURE_2D);
	gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, bitmap.width, bitmap.height, GL_RGB, GL_UNSIGNED_BYTE, bitmap.data);
	//glBindTexture(GL_TEXTURE_2D, texture[0]);
	
	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); //nic nie zmienia?
	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); //nic nie zmienia?

	glBegin(GL_QUADS);

		glTexCoord2f(0.0f, 0.0f);
		glVertex3f(-300.0f, -300.0f, 0.01f);
		glTexCoord2f(1.0f, 0.0f);
		glVertex3f(300.0f, -300.0f, 0.01f);
		glTexCoord2f(1.0f, 1.0f);
		glVertex3f(300.0f, 300.0f, 0.01f);
		glTexCoord2f(0.0f, 1.0f);
		glVertex3f(-300.0f, 300.0f, 0.01f);
		
	glEnd();

	//glBindTexture(GL_TEXTURE_2D, texture[1]);
	//gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, bitmap.width, bitmap.height, GL_RGB, GL_UNSIGNED_BYTE, bitmap.data);
	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); //nic nie zmienia?
	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); //nic nie zmienia?

	glBegin(GL_QUADS);

		glTexCoord2f(0.0f, 0.0f);
		glVertex3f(320.0f, -300.0f, 0.01f);
		glTexCoord2f(1.0f, 0.0f);
		glVertex3f(920.0f, -300.0f, 0.01f);
		glTexCoord2f(1.0f, 1.0f);
		glVertex3f(920.0f, 300.0f, 0.01f);
		glTexCoord2f(0.0f, 1.0f);
		glVertex3f(320.0f, 300.0f, 0.01f);
		
	glEnd();
	glDisable(GL_TEXTURE_2D);

}

/*************************************************************************************/